export default {
  install (Vue) {
    Vue.directive('img', {
      inserted (el, binding) {
        el.src = binding.value
        el.onerror = () => {
          el.src =
            'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
        }
      }
    })
  }
}
